class SweetPotato:
	def __init__(self):
		self.cookedString = '生的'
		self.cookedLevel = 0
		self.condiments = []

	# 可以将对象的地址的详情输出
	def __str__(self):
		return '地瓜状态:%s%d,添加的佐料有%s'%(self.cookedString,self.cookedLevel,str(self.condiments))

	def cook(self,cooked_time):

		# 使用当前对象的属性
		self.cookedLevel += cooked_time

		if  self.cookedLevel >= 0 and self.cookedLevel < 3:
			self.cookedString = '生的'
		elif self.cookedLevel >= 3 and self.cookedLevel < 5:
			self.cookedString = '半熟'
		elif self.cookedLevel >= 5 and self.cookedLevel < 8:
			self.cookedString = '熟了'
		elif self.cookedLevel > 5:
			self.cookedString = '烤糊了'


	def addCondiments(self,condiments):
		self.condiments.append(condiments)

# 创建一个地瓜对象
di_gua = SweetPotato()
print(di_gua)

# 开始烤地瓜
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
di_gua.addCondiments('大蒜')

print(di_gua)
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
di_gua.addCondiments('番茄')

print(di_gua)
di_gua.cook(1)
print(di_gua)
di_gua.cook(1)
print(di_gua)
